﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;

namespace VacationsRequest.Models
{
    public class VacationApproval
    {
        public Guid ID { get; set; }
        public Guid? IdUserApprove { get; set; }
        public int IdEmployee { get; set; }

        [DataType(DataType.Date)]
        public DateTime DateCreated { get; set; }
        [DataType(DataType.Date)]
        public DateTime FromDate { get; set; }
        [DataType(DataType.Date)]
        public DateTime ToDate { get; set; }

        [ForeignKey("Status")]
        public int IdStatus { get; set; }
        public virtual ApprovalStatus Status { get; set; }

        public bool Notified { get; set; }
        public int? NumDays { get; set; }
        public string Comment { get; set; }
        public string ApproverComment { get; set; }
        public bool? Deleted { get; set; }
        [DataType(DataType.Date)]
        public DateTime? ApprovalDate { get; set; }
    }

    public class ApprovalStatus
    {
        public int ID { get; set; }
        public string Description { get; set; }
    }

    public class ApprovalList
    {
        public Guid ID { get; set; }
        public string EmployeeName { get; set; }
        [DataType(DataType.Date)]
        public DateTime DateCreated { get; set; }
        [DataType(DataType.Date)]
        public DateTime FromDate { get; set; }
        [DataType(DataType.Date)]
        public DateTime ToDate { get; set; }

        public int IdStatus { get; set; }
        public string Status { get; set; }
        public int? NumDays { get; set; }
        public string ApproverComment { get; set; }
        public bool Notified { get; set; }
        [DataType(DataType.Date)]
        public DateTime? ApprovalDate { get; set; }

    }

    public class VacationApprovalDBContext : DbContext
    {
        public DbSet<VacationApproval> VacationApproval { get; set; }

        public DbSet<ApprovalStatus> ApprovalStatus { get; set; }
    }
}